s1=input().split(" ")
s2=input().split(" ")
s1.remove(s1[0])
s2.remove(s2[0])
arr=list()
for i in s1:
    if i not in s2 and i not in arr:
        if not len(arr):
            print(i,end="")
            arr.append(i)
        else:
            print(" ",end="")
            print(i,end="")
            arr.append(i)
for i in s2:
    if i not in s1 and i not in arr:
        if not len(arr):
            print(i,end="")
            arr.append(i)
        else:
            print(" ",end="")
            print(i,end="")
            arr.append(i)